import $api from '.';

interface Cangku {
  name: string;
  area: number | string;
  [key: string]: any;
}

// 添加仓库
export const addCangku = function (data: Cangku) {
  return $api.post('/cangku', data);
};

// 获取仓库列表
export const getCangkuList = function (data: { $limit: number; $skip: number }) {
  console.log('data', data);
  data.$limit = data.$limit || 20;
  data.$skip = data.$skip || 0;
  return $api.get('/cangku', {
    params: data,
  });
};

// 删除仓库
export const delCangku = function (id: number) {
  return $api.delete(`/cangku/${id}`);
};

// 修改商品信息
export const updateCangku = function (id: number, data: any) {
  return $api.patch(`/cangku/${id}`, data);
};

export default {};
